import type { PageParams, PageResult } from '@/types/global'
import type { jackWingingItem, KpcodeJackEntity, KpcodeJackWinningCountEntity } from '@/types/jack'
import { http } from '@/utils/http'

type JackSearchParams = {
  userName?: string
  openJackTime?: string
  jackPeriod?: string
  /** 页码：默认值为 1 */
  current?: number
  /** 页大小：默认值为 10 */
  size?: number
}
/**
 * 中奖名单
 * @param data 请求参数
 */
export const getJackWingListApi = (data?: JackSearchParams) => {
  return http<PageResult<jackWingingItem>>({
    method: 'GET',
    url: '/admin/home/jackWinningPage',
    data,
  })
}

/**
 * 中奖公告
 * @param data 请求参数
 */
export const getJackWingNoteListApi = () => {
  return http<KpcodeJackWinningCountEntity[]>({
    method: 'GET',
    url: '/admin/home/getJackWinCountList',
  })
}
